Handle wasm-bindgen wbg_cast helper in wasm hotpatching #4748
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
name_is_bindgen_symbolto recognize thewasm_bindgen::__rt::wbg_*cast helpers emitted by wasm-bindgen__wbindgen_*shimsMotivation
_ZN12wasm_bindgen4__rt8wbg_cast17breaks_if_inlined17ha430ab957428946fEenvimport unresolved and the browser aborts withLinkError: function import requires a callableRationale
__rt::wbg_*helpers are the same wasm-bindgen glue as the descriptors we already rewrite, so they should follow the identical indirect-call pathwasm_bindgen4__rt8wbg_prefix keeps the logic simple and aligned with wasm-bindgen’s naming convention, ensuring the patched module contains no stray importsTesting
dx new wasm-devtools(or reuse a Dioxus web app) and enable web devtools inDioxus.tomldx serve --hot-patch --web, edit a component to trigger a patch, and confirm the browser no longer throwsLinkError: function import requires a callable